package com.icinfo.cloud.provider.punish.fastcase.controller;

import com.icinfo.cloud.common.core.Validator.BaseGroup;
import com.icinfo.cloud.provider.punish.fastcase.service.IFastCaseService;
import com.icinfo.cloud.provider.punish.ucase.punishinform.dto.InformHtmlRequest;
import com.icinfo.cloud.provider.punish.ucase.punishinform.dto.PunishInformFormDto;
import com.icinfo.cloud.provider.punish.ucase.punishinform.vo.PunishInformFormVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 处罚告知
 * @author ChenHan
 * @date 2022/12/15 23:45
 **/
@RestController
@RequestMapping("/punish/inform")
@Slf4j
public class PunishInformController  extends BaseController {


    @Autowired
    private IFastCaseService fastCaseService;

    /**
     *  获取处罚告知表单数据
     *
     * @param request
     * @author chenhan
     * @date 2022年12月15日23:48:43
     */
    @PostMapping(value = "/getPunishInformFormBaseinfo", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<PunishInformFormVo> getPunishInformFormBaseinfo(@RequestBody @Validated(BaseGroup.Query.class) InformHtmlRequest request) {
        return fastCaseService.getPunishInformFormBaseinfo(request);
    }

    /**
     * 保存处罚告知表单数据
     * @param dto
     * @return {@link Result<String>}
     * @author liyafeng
     * @date 2022/2/17
     */
    @PostMapping(value = "/savePunishInformForm", produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<String> savePunishInformForm(@RequestBody PunishInformFormDto dto) {
        return fastCaseService.savePunishInformForm(dto);
    }

    @PostMapping(value = "/getIsNeedHearingResult")
    @ApiOperation(value = "查询是否符合听证条件")
    public Result<String> getIsNeedHearingResult(@RequestBody PunishInformFormDto punishInformFormDto){
        return fastCaseService.getIsNeedHearingResult(punishInformFormDto);
    }
}
